package com.jiyun.trainlist.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jiyun.model.Train;
import com.jiyun.trainlist.mapper.TrainMapper;
import com.jiyun.trainlist.service.TrainService;
import com.jiyun.vo.TrainVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TrainServiceImpl extends ServiceImpl<TrainMapper, Train> implements TrainService {

    @Autowired
    TrainMapper trainMapper;


    @Override
    public Page<TrainVo> findPage(Integer pageNum, Integer pageSize, TrainVo trainVo) {
        Page<TrainVo> trainVoPage = new Page<>(pageNum, pageSize);
        trainMapper.findPage(trainVoPage,trainVo);
        return trainVoPage;
    }

    @Override
    public List<TrainVo> findPeopleandTime(Integer id) {
        return trainMapper.findPeopleandTime(id);
    }

    @Override
    public void goCanjia(Integer id) {
        trainMapper.goCanjia(id);
    }
}
